<?php

declare(strict_types=1);
/**
 * This file is part of Hyperf.
 *
 * @link     https://www.hyperf.io
 * @document https://hyperf.wiki
 * @contact  group@hyperf.io
 * @license  https://github.com/hyperf/hyperf/blob/master/LICENSE
 */
use Hyperf\HttpServer\Router\Router;

Router::get('/ping', function () {
    return 'pong';
});

Router::addGroup("/auth",function (){
    //手机登录相关业务
    Router::addGroup("/phone",function (){
        Router::get("/code","App\Controller\Auth\PhoneController@code");//发送短信验证码
        Router::get("/check","App\Controller\Auth\PhoneController@check");//手机号检测
        Router::post("/login","App\Controller\Auth\PhoneController@login");//验证码登录
    });
});

Router::addGroup("/user",function (){
    Router::addGroup("/info",function (){
        Router::get("/profile","App\Controller\User\InfoController@profile");
    });
},["middleware"=>[
    \App\Middleware\JwtAuthMiddleware::class]
]);